Repository navigation
feat(schedule): a run booking can claim its hours - #347
Merged
Merged
Conversation
berth schedule book --claim books a run whose waiter drains any holder but a hold or a pinned lease, whatever the holder's priority. A batch run used to lose its hours to an idle foreground holder: on 2026-11-16 an idle strata-sc117 lease kept the card from 22:36 to 06:00 and all three requests in the 00:00 run were refused after 10 minutes. The claim is the operator's. Check refuses it on a priority change or a downtime, the gateway books none and answers 403 to a move or cancel of one, and the harbor form carries it through a move. Closes #345
…king # Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #345.
What changes
berth schedule book --claimbooks a run that claims its hours. While the booking lasts, the booked engine's waiter drains any holder except a hold or a pinned lease (a training is pinned), whatever the holder's priority. Without--claim, a run works as before.On 2026-11-16 a
batchrun forstrata(00:00 to 01:25) lost its hours to an idleforegroundlease,strata-sc117. That lease held the card from 22:36 until 06:00. All three requests in the window waited 10 minutes and were refused withheld by strata-sc117 [foreground, active].The claim belongs to the operator:
Booking.Checkrefuses a claim on a priority change or on downtime."claim"field in a POST body is ignored, andPATCHorDELETEon a claiming run returns403.berth scheduleshows the kind asrun (claim).The drain happens only when the booked engine asks for the card. A claim never empties the card for a job that does not show up.
Proof
TestClaimRunBookingDrainsAHigherHolder(broker) fails without the change: a batch run with a claim did not drain a foreground holder. It also checks that a run without a claim leaves the holder alone and that a claim never drains a hold.TestScheduleRoutesLeaveTheOperatorsBookings(gateway): a claim in the body books none, and move or cancel of a claiming run is a 403.TestScheduleAgainstADaemon(cli):--claimreaches the schedule file, the board shows it, and--kind down --claimis refused.TestCheckRefusesBadBookings(schedule): a claim on a priority booking is refused.go test ./..., the Windows build and vet, golangci-lint 2.14.0.